<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <span id="spanId">Hello Span</span><br>
    <button onclick="clickMe()">点击</button>

    <script type="text/javascript">
        function clickMe(){
            var spanObj =document.getElementById('spanId')
            spanObj.innerHTML ='<h1 style="color: red">innerText</h1>'
        }
    </script>
</body>
</html>